<template>
    <div id="code">
        <!-- <div class="headers">邀请有礼</div> -->
        <div class="code">
            <div class="code_top">
                <p class="img"><img :src="data.headImg" alt=""></p>
                <p>{{ data.name }}</p>
                <span>邀请您成为{{ data.hotelName }}会员</span>
                <!-- <p>{{ data.mobile}}</p> -->
            </div>
            <div class="code_b">
                <h3>会员特权</h3>
                <p>1、订房立减<span>60元</span>;</p>
                <p>2、 邀请好友入住，你可得最高<span class="em">50元</span>奖励;</p>
                <p>3、 住、退、续、开发票线上一键完成;</p>
                <p>4、 享受酒店水果拼盘、生日福利;</p>
            </div>
            <div class="footer" style="width:100%;text-align:center">
                 <img :src="data.url" alt="" style="width:3.06rem;height:3.06rem">
                  <p style="color:#999999;font-size:.24rem;margin-top:.18rem;">长按识别进入小程序</p>
            </div>           
        </div>
    </div>
</template>
<script>
import { XHeader } from "vux";
import { getCode } from "@/service/home.js";
import axios from "axios";
export default {
  components: {
    XHeader
  },
  data() {
    return {
      id: sessionStorage.id,
      data: ""
    };
  },
  mounted() {
    this._getCode();
  },
  methods: {
    _getCode() {
      var id = this.$route.query.id ? this.$route.query.id : 324;
      axios.post("/recommend/getCode?token=" + id).then(res => {
        this.data = res.data;
      });
    }
  }
};
</script>
<style scoped lang="less">
#code {
  width: 100%;
  height: 700px;
  background-image: linear-gradient(top, #8239d0, #d275f4);
  padding-top: 0.3rem;
  .headers {
    color: #fff;
    text-align: center;
    line-height: 0.5rem;
    margin: 0 0 0.7rem 0;
    font-size: 0.34rem;
  }
  .code {
    background: url(../../assets/QrCode.png) no-repeat;
    background-size: 100%;
    width: 90%;
    height: 10.64rem;
    margin: 0 auto;
    .code_top {
      text-align: center;
      p {
        color: #000000;
        font-size: 0.3rem;
      }
      span {
        font-size: 0.24rem;
        color: #999999;
      }
      .img {
        width: 100%;
        padding-top: 0.5rem;
        padding-bottom: 0.2rem;
        img {
          width: 1rem;
          height: 1rem;
          border-radius: 50%;
        }
      }
    }
    .code_b {
      h3 {
        height: 0.34rem;
        line-height: 0.34rem;
        color: #2a2a2a;
        font-size: 0.36rem;
        margin-top: 0.7rem;
        margin-bottom: 0.27rem;
        text-align: center;
      }
      p {
        font-size: 0.3rem;
        color: #323232;
        margin-bottom: 0.17rem;
        margin-left: 0.74rem;
        span {
          color: #fd382f;
        }
        .em {
          color: #ffa200;
        }
      }
    }
  }
}
</style>
